// @algorithm @lc id=100274 lang=cpp
// @title fei-bo-na-qi-shu-lie-lcof

#include "algm/algm.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
    // @test(45)=134903163
public:
    int fib(int n) {
        if (n < 2) {
            return n;
        }
        int p = 0, q = 1, r = 0;
        for (int i = 2; i <= n; ++i) {
            r = (p + q) % 1000000007;
            p = q;
            q = r;
        }
        return r;
    }
};